websocket服务,接收客户端的消息种类如下:1
2
3
4
5
6//WebsocketServer#init()
messageDispatcher.register(Command.HANDSHAKE, () -> new HandshakeHandler(mPushServer));
messageDispatcher.register(Command.BIND, () -> new BindUserHandler(mPushServer));
messageDispatcher.register(Command.UNBIND, () -> new BindUserHandler(mPushServer));
messageDispatcher.register(Command.PUSH, PushHandlerFactory::create);
messageDispatcher.register(Command.ACK, () -> new AckHandler(mPushServer));
1 | public final class WebsocketServer extends NettyTCPServer { |
WebSocketChannelHandler.java 处理socket消息
1 | .Sharable |